import java.util.Arrays;

public class text4 {
    public static void fun4(int[] array){
        for(int i=1;i< array.length;i++){
            for(int j=0;j< array.length-i;j++){
                if(array[j]>array[j+1]){
                    int tmp=array[j];
                    array[j]=array[j+1];
                    array[j+1]=tmp;
                }
            }
        }
    }
    public static void main(String[] args) {
        int[] array={1,4,5,8,1,7,6,3,2,4};
        fun4(array);
        System.out.println(Arrays.toString(array));
    }
}
